﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Drawing.Design;
using Microsoft.Practices.Modeling.ExtensionProvider.Metadata;
using Microsoft.Practices.Services.ItineraryDsl;
using Microsoft.Practices.Modeling.ExtensionProvider.Extension;
using Microsoft.Practices.Modeling.Common;
using Microsoft.Practices.Modeling.Validation;
using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;
using Microsoft.Practices.Services.Extenders;
using Microsoft.Practices.Modeling.Services.Design;
using Microsoft.Practices.Modeling.Common.Design;

namespace BizTalk.ESB.Extensions.ServiceExtenders
{
	[Serializable]
	[ObjectExtender(typeof(ItineraryService))]
    public class BamTrackingExtender : ItineraryServiceExtenderBase, IOrchestrationItineraryServiceExtender
	{
		[Editor(typeof(BiztalkOrchestrationServiceNameEditor), typeof(UITypeEditor))]
		[TypeConverter(typeof(TypeConverter))]
		[EditorOutputProperty(BiztalkOrchestrationServiceNameEditor.ServiceId, "ServiceId")]
		public override string ServiceName { get; set; }

		public override string ServiceType
		{
			get { return "Messaging"; }
		}

        [Category(ServiceProxyExtensionProvider.ExtensionProviderPropertyCategory),
            Description("BAM Activity to save business data to."),
            DisplayName("BAM Activity Definition Name"),
            ReadOnly(false),
            Browsable(true)]
        [XmlElement]
        [PersistInPropertyBag] 		//NOTE: This property will be persited in the service property bag
        public string ActivityDefinitionName { get; set; }

        [Category(ServiceProxyExtensionProvider.ExtensionProviderPropertyCategory),
            Description("Type of BAM Event Stream to use when tracking business data."),
            DisplayName("BAM Event Streaming Type to use"),
            ReadOnly(false),
            Browsable(true)]
        [XmlElement]
        [PersistInPropertyBag] 		//NOTE: This property will be persited in the service property bag
        public string BamEventStreamType { get; set; }

	}
}
